/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vendingmachine;

/**
 *
 * @author Jonathan Ery
 */
public class PaymentCounter {
    private int change;
    private boolean sufficient;
    
    public PaymentCounter(){
        change = 0;
        sufficient = false;
    }
    
    public PaymentCounter(int price, int paymentValue){
        if (paymentValue >= price){
            change = paymentValue-price;
            sufficient = true;
        }else{
            change = 0;
            sufficient = false;
        }
    }

    public int getChange() {
        return change;
    }

    public boolean isSufficient() {
        return sufficient;
    }
    
    
}
